package com.dlnu.sujiwords.controller;

import com.dlnu.sujiwords.domain.client.AjaxResult;
import com.dlnu.sujiwords.domain.client.UpdateMemorizesParameter;
import com.dlnu.sujiwords.service.IMemoriesNumberService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@CrossOrigin
@RequestMapping("/SuJiWords/MemoriesNumber")
public class MemoriesNumberController {
    @Resource
    private IMemoriesNumberService service;
    @GetMapping("/getMemoriesNumber/{phoneNumber}")
    public AjaxResult getMemoriesNumber(@PathVariable("phoneNumber")String phoneNumber){
        return service.getUserMemoriesNumber(phoneNumber);
    }
    @RequestMapping("/updateMemorize")
    public AjaxResult updateMemorizes(@RequestBody UpdateMemorizesParameter memorizes){
        return service.updateUserMemoriesNum(memorizes.getPhone(),memorizes.getTableNo(),memorizes.getMemorizeNum());
    }
}
